﻿using System;
namespace LCL.Bus
{
    public sealed class ActionDelegatedEventHandler<TEvent> : IEventHandler<TEvent>
        where TEvent :class, IEvent
    {
        #region Private Fields
        private readonly Action<TEvent> action;
        #endregion
        #region Ctor
        public ActionDelegatedEventHandler(Action<TEvent> action)
        {
            this.action = action;
        }
        #endregion
        #region IHandler<TDomainEvent> Members
        public void Handle(TEvent message)
        {
            action(message);
        }
        #endregion
    }
}
